package com.htc.model.request;

public class ProductCommentRequest  extends PageRequest{
	private Integer pid;
	private Integer uid;
	
	public Integer getPid() {
		return pid;
	}


	public void setPid(Integer pid) {
		this.pid = pid;
	}
	


	public Integer getUid() {
		return uid;
	}


	public void setUid(Integer uid) {
		this.uid = uid;
	}


	public String convertToWhere() {
		StringBuffer where = new StringBuffer(" where 1=1 ");
		
		if(pid!=null) {
			where.append(" and product_id="+pid);
		}
		if(uid!=null) {
			where.append(" and product_id in (select pid from product where consumer_id ="+uid+")");
		}
		
		return where.toString();
	}
	
	
	
}
